package com.specialized.passenger.service.impl;

import java.util.List;

import com.alibaba.nacos.api.remote.response.Response;
import com.specialized.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.specialized.passenger.mapper.ChatMsgMapper;
import com.specialized.passenger.domain.ChatMsg;
import com.specialized.passenger.service.IChatMsgService;

/**
 * 聊天记录Service业务层处理
 *
 * @author djh
 * @date 2024-07-19
 */
@Service
public class ChatMsgServiceImpl implements IChatMsgService {
    @Autowired
    private ChatMsgMapper chatMsgMapper;




    /**
     * 查询聊天记录
     *
     * @param chatId 聊天记录主键
     * @return 聊天记录
     */
    @Override
    public ChatMsg selectChatMsgByChatId(Long chatId) {
        return chatMsgMapper.selectChatMsgByChatId(chatId);
    }

    /**
     * 查询聊天记录列表
     *
     * @param chatMsg 聊天记录
     * @return 聊天记录
     */
    @Override
    public List<ChatMsg> selectChatMsgList(ChatMsg chatMsg) {
        return chatMsgMapper.selectChatMsgList(chatMsg);
    }

    /**
     * 新增聊天记录
     *
     * @param chatMsg 聊天记录
     * @return 结果
     */
    @Override
    public int insertChatMsg(ChatMsg chatMsg) {
                chatMsg.setCreateTime(DateUtils.getNowDate());
            return chatMsgMapper.insertChatMsg(chatMsg);
    }

    /**
     * 修改聊天记录
     *
     * @param chatMsg 聊天记录
     * @return 结果
     */
    @Override
    public int updateChatMsg(ChatMsg chatMsg) {
        return chatMsgMapper.updateChatMsg(chatMsg);
    }

    /**
     * 批量删除聊天记录
     *
     * @param chatIds 需要删除的聊天记录主键
     * @return 结果
     */
    @Override
    public int deleteChatMsgByChatIds(Long[] chatIds) {
        return chatMsgMapper.deleteChatMsgByChatIds(chatIds);
    }

    /**
     * 删除聊天记录信息
     *
     * @param chatId 聊天记录主键
     * @return 结果
     */
    @Override
    public int deleteChatMsgByChatId(Long chatId) {
        return chatMsgMapper.deleteChatMsgByChatId(chatId);
    }

    @Override
    public Response members() {
        return null;
    }
}
